package com.example.bawolf.corejava;

import org.springframework.util.StringUtils;

/**
 * ExceptionTest
 *
 * @author zhougf
 * @date 2020/03/14
 */
public class ExceptionTest {
    //测试catch异常是否返回
    private static String getNameByIdTest(Integer id) {
        try{
//            String test = String.valueOf(id);
            String test = id.toString();
            if(!StringUtils.isEmpty(test)) {
                return test;
            }
        } catch (Exception e) {
            throw e;
//            e.printStackTrace();
//            System.out.println("发生内部异常");
        }

        return null;

    }

    public static Boolean valueOf(boolean b) {
        return b ? Boolean.TRUE : Boolean.FALSE;
    }
    public static void main(String[] args) {
        System.out.println(valueOf(false));
//        System.out.println(getNameByIdTest(null));
    }
}
